package com.lp.common.exception;

import lombok.Getter;

/**
 * @program: backend
 * @description:
 * @author: Ke.Song
 * @since: 2024-03-11 21:15:43
 */
@Getter
public enum ErrorCodeEnum {

    /**
     * 异常值, 400
     */
    FAILED(400, "请求错误", "请求错误"),

    /**
     * The Params error.
     */
    PARAMS_ERROR(400, "参数错误", "参数错误"),

    /**
     * 4XX
     */
    DUPLICATE_DATA(400, "数据重复", "数据重复"),

    /**
     * 4XX
     */
    AUTHORIZED_FAILED(401, "未授权", "未授权"),

    /**
     * 4XX
     */
    CONTENT_VIOLATION(403, "内容违规", "参数错误"),

    /**
     * 权限不足
     */
    PERMISSION_ERROR(407, "权限不足", "权限不足"),

    /**
     * 500
     */
    SERVER_ERROR(500, "服务器异常", "服务器异常"),
    ;

    /**
     * 错误码
     * -- GETTER --
     *  Gets biz code.
     *

     */
    private final Integer bizCode;

    /**
     * 错误信息
     * -- GETTER --
     *  Gets msg.
     *

     */
    private final String msg;

    /**
     * 生产环境的错误信息
     */
    private final String prodMsg;


    /**
     * @param bizCode  业务错误码
     * @param msg      错误信息
     */
    ErrorCodeEnum(Integer bizCode, String msg, String prodMsg) {
        this.bizCode = bizCode;
        this.msg = msg;
        this.prodMsg = prodMsg;
    }

}

